<?php defined('BASEPATH') or exit('No direct script access allowed');

class Blog_helper{

	private static $ci;

	/**
	 * The Settings Construct
	 */
	
	public function __construct()
	{
		$this->ci =& get_instance();
		$this->ci->load->model('blog/post_model');
		$this->ci->load->model('blog/like_model');
	}
	
	function getMostViewed()
	{
		return $this->ci->post_model->order_by('total_view','desc')->limit(5)->find_all();
	}
	
	function getMostLiked()
	{
		return $this->ci->post_model->order_by('total_like','desc')->limit(5)->find_all();
	}
	
	
}